/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
define(["require", "exports", "./languageModeIds"], function (require, exports, languageModeIds) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    class VersionStatus {
        constructor(normalizePath, vscode) {
            this.normalizePath = normalizePath;
            this.vscode = vscode;
            this.versionBarEntry = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE);
            this.onChangeEditorSub = vscode.window.onDidChangeActiveTextEditor(this.showHideStatus, this);
        }
        dispose() {
            this.versionBarEntry.dispose();
            this.onChangeEditorSub.dispose();
        }
        // public onDidChangeTypeScriptVersion(version: TypeScriptVersion) {
        // 	this.showHideStatus();
        // 	this.versionBarEntry.text = version.versionString;
        // 	this.versionBarEntry.tooltip = version.path;
        // 	this.versionBarEntry.command = 'typescript.selectTypeScriptVersion';
        // }
        showHideStatus() {
            if (!this.vscode.window.activeTextEditor) {
                this.versionBarEntry.hide();
                return;
            }
            const doc = this.vscode.window.activeTextEditor.document;
            if (this.vscode.languages.match([languageModeIds.typescript, languageModeIds.typescriptreact], doc)) {
                if (this.normalizePath(doc.uri)) {
                    this.versionBarEntry.show();
                }
                else {
                    this.versionBarEntry.hide();
                }
                return;
            }
            if (!this.vscode.window.activeTextEditor.viewColumn) {
                // viewColumn is undefined for the debug/output panel, but we still want
                // to show the version info in the existing editor
                return;
            }
            this.versionBarEntry.hide();
        }
    }
    exports.default = VersionStatus;
});
